﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ArgusLib.FFmpeg.avcodec
{
	[Flags]
	public enum CodecCapabilities : uint
	{
		/// <summary>
		/// Decoder can use draw_horiz_band callback.
		/// </summary>
		CODEC_CAP_DRAW_HORIZ_BAND = 0x0001,

		/// <summary>
		/// Codec uses get_buffer() for allocating buffers and supports custom allocators.
		/// If not set, it might not use get_buffer() at all or use operations that
		/// assume the buffer was allocated by avcodec_default_get_buffer.
		/// </summary>
		CODEC_CAP_DR1             = 0x0002,

		CODEC_CAP_TRUNCATED       = 0x0008,

		/// <summary>
		/// Codec can export data for HW decoding (XvMC).
		/// </summary>
		CODEC_CAP_HWACCEL         = 0x0010,

		/// <summary>
		/// Encoder or decoder requires flushing with NULL input at the end in order to
		/// give the complete and correct output.
		/// 
		/// NOTE: If this flag is not set, the codec is guaranteed to never be fed with
		///       with NULL data. The user can still send NULL data to the public encode
		///       or decode function, but libavcodec will not pass it along to the codec
		///       unless this flag is set.
		///       
		/// Decoders:
		/// The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
		/// avpkt->size=0 at the end to get the delayed data until the decoder no longer
		/// returns frames.
		/// 
		/// Encoders:
		/// The encoder needs to be fed with NULL data at the end of encoding until the
		/// encoder no longer returns data.
		/// 
		/// NOTE: For encoders implementing the AVCodec.encode2() function, setting this
		///       flag also means that the encoder must set the pts and duration for
		///       each output packet. If this flag is not set, the pts and duration will
		///       be determined by libavcodec from the input frame.
		/// </summary>
		CODEC_CAP_DELAY           = 0x0020,

		/// <summary>
		/// Codec can be fed a final frame with a smaller size.
		/// This can be used to prevent truncation of the last audio samples.
		/// </summary>
		CODEC_CAP_SMALL_LAST_FRAME = 0x0040,

		#if FF_API_CAP_VDPAU
		/// <summary>
		/// Codec can export data for HW decoding (VDPAU).
		/// </summary>
		CODEC_CAP_HWACCEL_VDPAU    = 0x0080
		#endif

		/// <summary>
		/// Codec can output multiple frames per AVPacket
		/// Normally demuxers return one frame at a time, demuxers which do not do
		/// are connected to a parser to split what they return into proper frames.
		/// This flag is reserved to the very rare category of codecs which have a
		/// bitstream that cannot be split into frames without timeconsuming
		/// operations like full decoding. Demuxers carring such bitstreams thus
		/// may return multiple frames in a packet. This has many disadvantages like
		/// prohibiting stream copy in many cases thus it should only be considered
		/// as a last resort.
		/// </summary>
		CODEC_CAP_SUBFRAMES        = 0x0100,

		/// <summary>
		/// Codec is experimental and is thus avoided in favor of non experimental
		/// encoders
		/// </summary>
		CODEC_CAP_EXPERIMENTAL     = 0x0200,

		/// <summary>
		/// Codec should fill in channel configuration and samplerate instead of container
		/// </summary>
		CODEC_CAP_CHANNEL_CONF     = 0x0400,

		/// <summary>
		/// Codec is able to deal with negative linesizes
		/// </summary>
		CODEC_CAP_NEG_LINESIZES    = 0x0800,

		/// <summary>
		/// Codec supports frame-level multithreading.
		/// </summary>
		CODEC_CAP_FRAME_THREADS    = 0x1000,

		/// <summary>
		/// Codec supports slice-based (or partition-based) multithreading.
		/// </summary>
		CODEC_CAP_SLICE_THREADS    = 0x2000,

		/// <summary>
		/// Codec supports changed parameters at any point.
		/// </summary>
		CODEC_CAP_PARAM_CHANGE     = 0x4000,

		/// <summary>
		/// Codec supports avctx->thread_count == 0 (auto).
		/// </summary>
		CODEC_CAP_AUTO_THREADS     = 0x8000,

		/// <summary>
		/// Audio encoder supports receiving a different number of samples in each call.
		/// </summary>
		CODEC_CAP_VARIABLE_FRAME_SIZE = 0x10000,

		/// <summary>
		/// Codec is intra only.
		/// </summary>
		CODEC_CAP_INTRA_ONLY       = 0x40000000,

		/// <summary>
		/// Codec is lossless.
		/// </summary>
		CODEC_CAP_LOSSLESS         = 0x80000000,
	}
}
